// 引入请求
import re from "./utlils/re"
// app.js
App({
  onLaunch: function () {
    // 1、获取用户信息
    let infos = ''
    wx.getUserInfo({
      success: (info) => {
        //  2、获取登录code
        wx.login({
          success: (res) => {
            // 小程序登录
            re({
              url: "vv1/login",
              data: {
                code: res.code,
                uid: "6274dbd6421606b378aa98b6",
                userinfo: info
              }, success: (data) => {
                // 保存小程序登录信息
                wx.setStorageSync('infos', data.data.data)
                // 单独储存openid
                wx.setStorageSync('openid', data.data.data.openid)
              }
            })

          }
        })
      }
    })
  }
});
